_rrrr_eeee_cccc_vvvv_,,,, _rrrr_eeee_cccc_vvvv_ffff_rrrr_oooo_mmmm_,,,, _rrrr_eeee_cccc_vvvv_mmmm_ssss_gggg - receive a message from a socket
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
#include <sys/types.h>
int recv(int s, char *buf, int len, int flags);
int recvfrom(int s, char *buf, int len, int flags, caddr_t from,
int *fromlen);
int recvmsg(int s, struct msghdr *msg, int flags);
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_s is a socket created with _ssss_oooo_cccc_kkkk_eeee_tttt. _rrrr_eeee_cccc_vvvv, _rrrr_eeee_cccc_vvvv_ffff_rrrr_oooo_mmmm, and _rrrr_eeee_cccc_vvvv_mmmm_ssss_gggg are used
to receive messages from another socket. _rrrr_eeee_cccc_vvvv may be used only on a
_c_o_n_n_e_c_t_e_d socket [see _cccc_oooo_nnnn_nnnn_eeee_cccc_tttt(3N)], while _rrrr_eeee_cccc_vvvv_ffff_rrrr_oooo_mmmm and _rrrr_eeee_cccc_vvvv_mmmm_ssss_gggg may be
used to receive data on a socket whether it is in a connected state or
not.
If _f_r_o_m is not a _NNNN_UUUU_LLLL_LLLL pointer, the source address of the message is
filled in. _f_r_o_m_l_e_n is a value-result parameter, initialized to the size
of the buffer associated with _f_r_o_m, and modified on return to indicate
the actual size of the address stored there. The length of the message
is returned. If a message is too long to fit in the supplied buffer,
excess bytes may be discarded depending on the type of socket the message
is received from [see _ssss_oooo_cccc_kkkk_eeee_tttt(3N)].
If no messages are available at the socket, the receive call waits for a
message to arrive, unless the socket is nonblocking [see _ffff_cccc_nnnn_tttt_llll(2)] in
which case _----_1111 is returned with the external variable _eeee_rrrr_rrrr_nnnn_oooo set to
The type of address structure passed to _rrrr_eeee_cccc_vvvv depends on the address
family. UNIX domain sockets (address family _AAAA_FFFF______UUUU_NNNN_IIII_XXXX) require a
_ssss_oooo_cccc_kkkk_eeee_tttt_aaaa_dddd_dddd_rrrr______uuuu_nnnn structure as defined in _ssss_yyyy_ssss_////_uuuu_nnnn_...._hhhh; Internet domain sockets
(address family _AAAA_FFFF______IIII_NNNN_EEEE_TTTT) require a _ssss_oooo_cccc_kkkk_aaaa_dddd_dddd_rrrr______iiii_nnnn structure as defined in
_nnnn_eeee_tttt_iiii_nnnn_eeee_tttt_////_iiii_nnnn_...._hhhh. Other address families may require other structures. Use
the structure appropriate to the address family; cast the structure
address to a generic _cccc_aaaa_dddd_dddd_rrrr______tttt in the call to _rrrr_eeee_cccc_vvvv and pass the size of the